home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 30 / Amiga Format AFCD30 (Sep 1998, Issue 114).iso / -seriously_amiga- / sound / autodrums / autodrum_demo.rexx next >
OS/2 REXX Batch file  |  1998-06-22  |  9KB  |  250 lines

  1. /*************************************************************************/
  2. /* $VER: AutoDrum 5.0                                                    */
  3. /*************************************************************************/
  4. /*
  5. gui_file = arg(1)
  6. */
  7. gui_file = 'rexx:gui/octamed-d.gui'
  8.  
  9. say 'Radius OctaMED AutoDRUMS  (c) 1998 1997 D. Krupicz'
  10. say '   OctaMED Drum Machine / Interactive GUI guide. '
  11. say '   CLICK on the gadgets in the AutoDrums window for documentation'
  12. say '   of functions.'
  13. say ' '
  14. say '   OctaMED AutoDRUMS requires OctaMED SoundStudio 1.03c or greater '
  15. say '                              VAREXX gui interface for AREXX '
  16. say '   The included font can be used in octamed if you want AutoDRUMS to display '
  17. say '   the proper graphics for notes ø , play Þ  , and stop Å  '
  18. say '   CycleToMenu 2.1 by F.Giannici makes this program a LOT EASIER to use!!!'
  19. say '   AutoDrums requires the GUI file "octamed-d.gui" to be located in'
  20. say '      the directory rexx:gui '
  21. say ' '
  22.  
  23. IF EXISTS("libs:rexxsupport.library") THEN DO
  24.     IF ~SHOW("L","rexxsupport.library") THEN
  25.         IF ~ADDLIB("rexxsupport.library",0,-30,0) THEN EXIT
  26. END
  27. ELSE EXIT
  28.  
  29. IF EXISTS("libs:rexxreqtools.library") THEN DO
  30.     IF ~SHOW("L","rexxreqtools.library") THEN
  31.         IF ~ADDLIB("rexxreqtools.library",0,-30) THEN EXIT
  32. END
  33. ELSE EXIT
  34.  
  35. OPTIONS RESULTS
  36. OPTIONS FAILAT 10
  37.  
  38. SIGNAL ON SYNTAX
  39. SIGNAL ON FAILURE 
  40.  
  41. /* Get the GUI file from the user */
  42. IF gui_file = '' THEN
  43.   DO
  44.     gui_file=rtfilerequest('REXX:gui',,'Varexx Request','_Load','rt_reqpos=reqpos_centerscr rtfi_matchpat=#?.gui rtfi_flags=freqf_patgad')
  45.     IF gui_file = '' THEN EXIT
  46.   END
  47.  
  48. /* Check Varexx is loaded if not load it */
  49. IF SHOW( 'p', 'VAREXX' ) ~= 1 THEN DO
  50.    say 'OctaMED AutoDrums requires the VAREXX program to run.'
  51.    exit
  52. END
  53. ADDRESS VAREXX
  54.  
  55. IF OPENPORT("HOLLY") = 0 THEN DO
  56.     CALL rtezrequest "Could not open a port.",, "Varexx Error"
  57.     EXIT
  58. END
  59.  
  60. /*  'load ' gui_file 'HOLLY'  */ /*normal screen */
  61. 'load ' gui_file 'HOLLY '  /*go to octamed screen */
  62.  
  63. vhost = RESULT
  64. /* say rc externerror */
  65. ADDRESS VALUE vhost
  66.  
  67. show
  68.  
  69. /**************************************************************************/
  70. /* MAIN LOOP -- Check for GUI events                                      */
  71. /**************************************************************************/
  72. DO FOREVER
  73.    CALL WAITPKT("HOLLY")
  74.    packet = GETPKT("HOLLY")
  75.    IF packet ~= '00000000'x THEN DO
  76.       class = GETARG(packet)
  77.  
  78.    IF class = "CLOSEWINDOW" THEN LEAVE
  79.  
  80.    IF left( class , 7 ) = "_LENGTH" THEN DO
  81.       say 'This sets the length of the beat in multiples of 16'
  82.       say '   it is best to set this to 1/4 of the block length'
  83.       END
  84.  
  85.    IF left( class , 1 ) = "A" THEN DO
  86.       say 'These gadgets write the corresponding note data into'
  87.       say '   each particular track.  The note pattern entered'
  88.       say '   is shown in the cycle gadget.  For easier use, it'
  89.       say '   is recommended that you install CycleToMenu 2.1'
  90.       say '   which will convert cycle gadgets into popup menus.'
  91.       END
  92.  
  93.    IF left( class , 1 ) = "B" THEN DO
  94.      say 'These gadgets write the corresponding note data into'
  95.      say '   each particular track.  The note pattern entered'
  96.      say '   is shown in the cycle gadget.  For easier use, it'
  97.      say '   is recommended that you install CycleToMenu 2.1'
  98.      say '   which will convert cycle gadgets into popup menus.'
  99.      END
  100.  
  101.    IF left( class , 1 ) = "C" THEN DO
  102.       say 'These gadgets write the corresponding note data into'
  103.       say '   each particular track.  The note pattern entered'
  104.       say '   is shown in the cycle gadget.  For easier use, it'
  105.       say '   is recommended that you install CycleToMenu 2.1'
  106.       say '   which will convert cycle gadgets into popup menus.'
  107.        END
  108.  
  109.    IF left( class , 1 ) = "D" THEN DO
  110.       say 'These gadgets write the corresponding note data into'
  111.       say '   each particular track.  The note pattern entered'
  112.       say '   is shown in the cycle gadget.  For easier use, it'
  113.       say '   is recommended that you install CycleToMenu 2.1'
  114.       say '   which will convert cycle gadgets into popup menus.'
  115.       END
  116.  
  117.    IF left( class , 1 ) = 'K' THEN DO     /* if aKcenting */
  118.       say 'These gadgets write the corresponding volume accent data into'
  119.       say '   each particular track, using command 0Cxx.  The pattern entered'
  120.       say '   is shown in the cycle gadget.  For easier use, it'
  121.       say '   is recommended that you install CycleToMenu 2.1'
  122.       say '   which will convert cycle gadgets into popup menus.'
  123.       END
  124.  
  125. /* setting inst_x commands */
  126.       IF left( class , 6 ) = "_SETAL" THEN DO
  127.          say 'This DECREASES the default instrument number for track 0'
  128.          say '   the instrument name will appear in the text gadget.'
  129.          END
  130.      IF left( class , 6 ) = "_SETAG" THEN DO
  131.          IF left( class , 8 ) = "_SETAGET" THEN DO
  132.          say 'This selects the current instr. as the default instrument number for track 0'
  133.          say '   the instrument name will appear in the text gadget.'
  134.          END
  135.          ELSE DO
  136.          say 'This INCREASES the default instrument number for track 0'
  137.          say '   the instrument name will appear in the text gadget.'
  138.          END
  139.          END
  140.    
  141.  
  142.      IF left( class , 6 ) = "_SETBL" THEN DO
  143.          say 'This DECREASES the default instrument number for track 1'
  144.          say '   the instrument name will appear in the text gadget.'
  145.          END
  146.       IF left( class , 6 ) = "_SETBG" THEN DO
  147.          IF left( class , 8 ) = "_SETBGET" THEN DO
  148.          say 'This selects the current instr. as the default instrument number for track 1'
  149.          say '   the instrument name will appear in the text gadget.'
  150.          END
  151.          ELSE DO
  152.          say 'This INCREASES the default instrument number for track 1'
  153.          say '   the instrument name will appear in the text gadget.'
  154.          END
  155.          END
  156.      IF left( class , 6 ) = "_SETCL" THEN DO
  157.          say 'This DECREASES the default instrument number for track 2'
  158.          say '   the instrument name will appear in the text gadget.'
  159.          END
  160.      IF left( class , 6 ) = "_SETCG" THEN DO
  161.          IF left( class , 8 ) = "_SETCGET" THEN DO
  162.          say 'This selects the current instr. as the default instrument number for track 2'
  163.          say '   the instrument name will appear in the text gadget.'
  164.          END
  165.          ELSE DO
  166.          say 'This INCREASES the default instrument number for track 2'
  167.          say '   the instrument name will appear in the text gadget.'
  168.          END
  169.          END
  170.    
  171.     IF left( class , 6 ) = "_SETDL" THEN DO
  172.          say 'This DECREASES the default instrument number for track 3'
  173.          say '   the instrument name will appear in the text gadget.'
  174.          END
  175.      IF left( class , 6 ) = "_SETDG" THEN DO
  176.          IF left( class , 8 ) = "_SETDGET" THEN DO
  177.          say 'This selects the current instr. as the default instrument number for track 3'
  178.          say '   the instrument name will appear in the text gadget.'
  179.          END
  180.          ELSE DO
  181.          say 'This INCREASES the default instrument number for track 3'
  182.          say '   the instrument name will appear in the text gadget.'
  183.          END
  184.          END
  185.    
  186.  
  187. /* end of inst select segment */
  188.  
  189.    IF left( class , 4 ) = "_NEW" THEN DO
  190.       say 'This clears the associated track and resets the cycle gadgets.'
  191.       END
  192.  
  193.    IF class = "_UPDATE" THEN DO
  194.       say 'This COPIES the first quarter of the block into the rest of the'
  195.       say '   block ASSUMING:                               '
  196.       say '   - that the LENGTH gadget is set to 1/4 of the block length'
  197.       say '   - and that your F6 to F10 keys are set for quarter-block positioning'
  198.       say '     in OctaMED.'
  199.       say '   Playing will stop while this is taking place. '
  200.       END
  201.  
  202.    IF class = "_APPEND" THEN DO
  203.       say 'This COPIES the entire block to a new block which is APPENDED to the'
  204.       say '   end of the current block list.'
  205.       END
  206.  
  207.    IF class = "_INSERT" THEN DO
  208.       say 'This COPIES the entire block to a new block which is INSERTED before the'
  209.       say '   current block.'
  210.        END
  211.  
  212.     IF class = "_PLAY" THEN DO
  213.       say 'This plays the block.'
  214.      END
  215.  
  216.     IF class = "_STOP" THEN DO
  217.      say 'This stops the block playing.'
  218.        END
  219.  
  220.     IF class = "_CLEAR" THEN DO
  221.        say 'This clears tracks 0 to 3'
  222.          END
  223.  
  224.     END
  225. END
  226.  
  227.     'hide unload'    
  228.  
  229.     CALL CLOSEPORT( "HOLLY" )
  230. EXIT
  231.  
  232. /* Error messages */
  233. failure:
  234.     SAY "Error code" rc "-- Line" SIGL
  235.     SAY EXTERNERROR
  236.     'hide unload'
  237.     CALL CLOSEPORT ("HOLLY")
  238.  
  239. EXIT
  240.  
  241. syntax:
  242.     SAY "Error" rc  "-- Line" SIGL
  243.     SAY ERRORTEXT( rc )
  244.     'hide unload'
  245.     CALL CLOSEPORT ("HOLLY")
  246. EXIT
  247.  
  248.  
  249.  
  250.